package org.ling.xuan.config;

public class TableConfig {
    public static String commonSetting() {
        return "CREATE TABLE IF NOT EXISTS common_setting (\n" +
                "  user_name VARCHAR(50) NOT NULL DEFAULT '',\n" +
                "  password VARCHAR(50) NOT NULL DEFAULT '',\n" +
                "  auth VARCHAR(50) NOT NULL DEFAULT '',\n" +
                "  email_contact VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  email_template VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  upload_modify_template VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  upload_modify_des VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  upload_customs_test_des VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  upload_test_des VARCHAR(1000) NOT NULL DEFAULT ''\n" +
                ");";
    }

    public static String emailSetting() {
        return "CREATE TABLE IF NOT EXISTS  email_setting (\n" +
                "    host VARCHAR(255) NOT NULL DEFAULT '',\n" +
                "    port INT NOT NULL DEFAULT 993,\n" +
                "    email VARCHAR(255) NOT NULL DEFAULT '',\n" +
                "    password VARCHAR(255) NOT NULL DEFAULT '',\n" +
                "    ssl BOOLEAN NOT NULL DEFAULT false,\n" +
                "    ctd_time TIMESTAMP NOT NULL\n" +
                ");\n";
    }

    public static String localAdd() {
        return "CREATE TABLE IF NOT EXISTS  local_add (\n" +
                "  id VARCHAR(65) NOT NULL,\n" +
                "  modify_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  ctd_time DATETIME NOT NULL,\n" +
                "  add_msg CLOB,\n" +
                "  remark VARCHAR(255) NOT NULL DEFAULT '',\n"+
                "  modify_version VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  commited BOOLEAN NOT NULL DEFAULT false,\n" +
                "  sended BOOLEAN NOT NULL DEFAULT false,\n"+
                "  send BOOLEAN NOT NULL DEFAULT false,\n" +
                "  require_bank VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  bank_code VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  requirement_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  requirement_des CLOB,\n" +
                "  mark_file_ids CLOB,\n" +
                "  cur BOOLEAN NOT NULL DEFAULT false,\n" +
                "  deleted BOOLEAN NOT NULL DEFAULT false,\n" +
                "  PRIMARY KEY (id)\n" +
                ");";
    }

    public static String markFile() {
        return "CREATE TABLE IF NOT EXISTS  mark_file (\n" +
                "  id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  project_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  project_name VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  remark VARCHAR(255) NOT NULL DEFAULT '',\n"+
                "  add_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  svn_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  file_name VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  file_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  ctd_time DATETIME NOT NULL,\n" +
                "  relation BOOLEAN NOT NULL DEFAULT false,\n" +
                "  deleted BOOLEAN NOT NULL DEFAULT false,\n" +
                "  PRIMARY KEY (id)\n" +
                ");\n";
    }

    public static String projectSetting() {
        return "CREATE TABLE IF NOT EXISTS project_setting (\n" +
                "  id VARCHAR(65) PRIMARY KEY,\n" +
                "  local_pre VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  svn_pre VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  add_pre VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  zip_pre VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  compile_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  build_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  union_commit_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  deleted BOOLEAN NOT NULL DEFAULT FALSE,\n" +
                "  project_path VARCHAR(1000) NOT NULL,\n" +
                "  web_path VARCHAR(1000) NOT NULL DEFAULT '',\n" +
                "  project_name VARCHAR(50) NOT NULL DEFAULT '',\n" +
                "  ctd_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" +
                "  system_name VARCHAR(1000) NOT NULL DEFAULT ''\n" +
                ");\n";
    }

    public static String sendRecord() {
        return "CREATE TABLE IF NOT EXISTS  send_record (\n" +
                "  id VARCHAR(65) NOT NULL,\n" +
                "  target_email CLOB NOT NULL,\n" +
                "  title CLOB NOT NULL,\n" +
                "  add_ids CLOB,\n" +
                "  modify_ids CLOB,\n" +
                "  require_bank CLOB NOT NULL,\n" +
                "  requirement_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  requirement_des CLOB NOT NULL,\n" +
                "  send_msg CLOB NOT NULL,\n" +
                "  deleted BOOLEAN NOT NULL DEFAULT false,\n" +
                "  mark_file_ids CLOB,\n" +
                "  zip_names CLOB,\n" +
                "  zip_paths CLOB,\n" +
                "  ctd_time DATETIME NOT NULL,\n" +
                "  PRIMARY KEY (id)\n" +
                ");\n";
    }

    public static String uploadRecord() {
        return "CREATE TABLE IF NOT EXISTS  upload_record (\n" +
                "  id VARCHAR(65) NOT NULL,\n" +
                "  add_ids CLOB,\n" +
                "  modify_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  require_id VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  require_bank VARCHAR(65) NOT NULL DEFAULT '',\n" +
                "  requirement_des CLOB,\n" +
                "  modify_files CLOB,\n" +
                "  modify_des CLOB,\n" +
                "  custom_test_des CLOB,\n" +
                "  test_des CLOB,\n" +
                "  mark_file_ids CLOB,\n" +
                "  deleted BOOLEAN NOT NULL DEFAULT false,\n" +
                "  ctd_time DATETIME NOT NULL,\n" +
                "  PRIMARY KEY (id)\n" +
                ");\n";
    }
}
